from appium.webdriver.common.appiumby import AppiumBy
from AppTest.page.base_page import BasePage


class BfMemberPage(BasePage):

    # 入职审批
    __BUTTON_EMPDETAIL = (
        AppiumBy.XPATH,
        "//android.view.View[@content-desc='​转​正​管​理​']/parent::*/following-sibling::*/child::*/child::*[2]")
    __BUTTON_DINDUCTION = (AppiumBy.XPATH, "//android.widget.Button[@content-desc='确认转正']")
    __BUTTON_PROBATION = (AppiumBy.XPATH, "//android.view.View[@content-desc='实际转正日期']/following::*[1]")



    # 入职审批
    def to_empdetail(self):
        self.do_click(self.__BUTTON_EMPDETAIL)

    def to_dinduction(self):
        self.do_click(self.__BUTTON_DINDUCTION)

    def set_probation(self):
        self.do_click(self.__BUTTON_PROBATION)
        by = (AppiumBy.XPATH, "	//android.widget.Button[@content-desc='确定']")
        self.do_click(by)



